package org.lds.hotkey.console.business.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.lds.hotkey.common.util.AssertUtil;
import org.lds.hotkey.console.business.app.entity.App;
import org.lds.hotkey.console.business.app.mapper.AppMapper;
import org.lds.hotkey.console.business.app.service.AppService;
import org.lds.hotkey.console.common.enums.ConsoleErrorEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * 服务实现类
 *
 * @author lidongsheng
 * @since 2024-06-05
 */
@Service
public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements AppService {

    @Autowired
    private AppMapper appMapper;

    @Override
    public void existApp(Long appId) {
        if (appId == null) return;
        App app = appMapper.selectById(appId);
        AssertUtil.assertTrue(Objects.nonNull(app), ConsoleErrorEnum.APP_NOT_EXIST);
    }
}
